#!/bin/bash
#	
#	命令：
#  ./smart_install.sh

#

# 默认值
version=wxashop1
mysql_ip=127.0.01
mysql_port=3106
mysql_db=sport_wear
mysql_user=root
mysql_pwd=98ds17456@#!0
redis_ip=127.0.01
redis_port=6179
redis_pwd=123456XX...!!00
redis_db=0
dada_port=8181

docker login -u admin0099 -p 123456XX... registry.cn-hangzhou.aliyuncs.com
docker pull registry.cn-hangzhou.aliyuncs.com/dashang/dashang3bak:wxashop
docker rm -f $version


# 运行
docker run -d -p $dada_port:8080 --name $version -v /data:/data -v /etc/localtime:/etc/localtime -e mysql_ip=$mysql_ip -e mysql_port=$mysql_port -e mysql_user=$mysql_user -e mysql_pwd=$mysql_pwd -e mysql_db=$mysql_db -e redis_ip=$redis_ip -e redis_port=$redis_port -e redis_pwd=$redis_pwd -e redis_db=$redis_db --restart=always --add-host=www.springframework.org:104.25.250.7 registry.cn-hangzhou.aliyuncs.com/dashang/dashang3bak:wxashop;
echo ""echo ""

echo ">>>>>>>> Docker运行状态 <<<<<<<<"
echo ""
docker logs -f $version
echo ""

